<!-- Modal para mostrar diálogo de confirmación al eliminar un registro -->
<div class="modal fade" tabindex="-1" role="dialog" id="modalDiscardSysNot">
       <div class="modal-dialog">
              <div class="modal-content">
                     <div class="modal-header">
                           <h4 class="modal-title" th:text="#{modal.discard.sysnot.title}"></h4>
                           <button type="button" class="close"
                                  onclick="closeModalButton('modalDiscardSysNot', 'discardSysNotForm')"
                                  aria-label="Cerrar">
                                  <span aria-hidden="true">&times;</span>
                           </button>
                     </div>
                     <div class="modal-body">
                           <form name="altEditor-form" role="form" id="discardSysNotForm" 
                                  th:action="@{/deletesysnot}" method="post">
                                  
                                  <input type='hidden' th:value="${ids}" id="ids" />
                                  <input type='hidden' th:value="${indexes}" id="indexes" />
                                  
                                 <p th:text="#{modal.discardSysNot.message}"></p>
                                  
                            </form>
                     </div>
                     <div class="modal-footer">

                           <button type="button" class="btn btn-default"
                                  onclick="closeModalButton('modalDiscardSysNot', 'discardSysNotForm')"
                                  th:text="#{form.btn.cancel}"></button>

                           <button type="button" id="idModDiscardSysnotBtn" class="btn btn-danger"
                                  th:text="#{form.btn.discardsysnot.discard}" onclick="discardSysNot();"></button>
                     </div>
              </div>
       </div>
</div>
<script th:inline="javascript">
function discardSysNot(){
	
	var actionDelete = /*[[@{/deletesysnot}]]*/;
	var tblSysNot = $('#sysnotTable').DataTable();
	var ids = document.getElementById('ids').value;
	var indexes = document.getElementById('indexes').value;
	
	$.ajax(actionDelete,{
		data:$.param({'ids':ids, 'indexes':indexes}),
		type:'GET',
		contentType: false,
		processData : false,
		success: function(data){
			//Se oculta la capa 'cargando...'
			hide();
			closeModalButton('modalDiscardSysNot', 'discardSysNotForm');
			tblSysNot.draw();
		},
		error:function(){
			alert("error al eliminar");
		}
		});
}
</script>